<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [2,3,4];
        // 将 arr 分别赋值给 a,b,c 
        let [a, b, c] = arr;
        console.log(a, b, c);
        
        // 将 arr 的第一个数值和最后一个数值分别赋给 d e
        let [d, ,e] = arr;
        console.log(d, e);
        
        // 将 第一个赋给 f, 其余赋给 test 
        let[f, ...test] = arr;
        console.log(f, test);

        // 练习
        let arr2 = [3, [4, 5], 6]
        let [ ,[m, n]] = arr2;
        console.log(m, n);
        
    </script>
</body>
</html>